home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / glibmm-2.4 / glibmm / error.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  1.9 KB  |  78 lines

  1. // -*- c++ -*-
  2. #ifndef _GLIBMM_ERROR_H
  3. #define _GLIBMM_ERROR_H
  4. /* $Id: error.h,v 1.1.1.1 2003/01/07 16:58:45 murrayc Exp $ */
  5.  
  6. /* Copyright 2002 The gtkmm Development Team
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  24. extern "C" { typedef struct _GError GError; }
  25. #endif
  26.  
  27. #include <glib/gquark.h>
  28. #include <glibmm/exception.h>
  29.  
  30.  
  31. namespace Glib
  32. {
  33.  
  34. class Error : public Glib::Exception
  35. {
  36. public:
  37.   Error();
  38.   Error(GQuark domain, int code, const Glib::ustring& message);
  39.   explicit Error(GError* gobject, bool take_copy = false);
  40.  
  41.   Error(const Error& other);
  42.   Error& operator=(const Error& other);
  43.  
  44.   virtual ~Error() throw();
  45.  
  46.   GQuark domain() const;
  47.   int code() const;
  48.   virtual Glib::ustring what() const;
  49.  
  50.   bool matches(GQuark domain, int code) const;
  51.  
  52.   GError* gobj();
  53.   const GError* gobj() const;
  54.  
  55. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  56.  
  57.   void propagate(GError** dest);
  58.  
  59.   typedef void (* ThrowFunc) (GError*);
  60.  
  61.   static void register_init();
  62.   static void register_cleanup();
  63.   static void register_domain(GQuark domain, ThrowFunc throw_func);
  64.  
  65.   static void throw_exception(GError* gobject) G_GNUC_NORETURN;
  66.  
  67. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  68.  
  69. protected:
  70.   GError* gobject_;
  71. };
  72.  
  73. } // namespace Glib
  74.  
  75.  
  76. #endif /* _GLIBMM_ERROR_H */
  77.  
  78.